// 高精度减法

#include <iostream>
#include <vector>
#include <fstream>

using namespace std;

int main()
{
    fstream fin;
    fstream fout;

    fin.open("file.in", ios_base::in);
    fout.open("file.out", ios_base::out | ios_base::trunc);

    string aStr, bStr;
    fin >> aStr >> bStr;


    int aLen = aStr.length(); // aStr: "1234567"
    int bLen = bStr.length(); // bStr:     "666"

    // 将较大的数值放在 aStr
    if(aLen < bLen || (aLen==bLen && aStr<bStr))
    {
        aStr.swap(bStr);
        fout << "-";
    }

    // 将 aStr 放入 a[ 1 2 3 4 5 6 7 ]
    vector<int> a;
    for(char c : aStr)
        a.push_back(c - '0');

    // 将 bStr 放入 b[ 0 0 0 0 6 6 6 ]
    vector<int> b;
    for(char c : bStr)
        b.push_back(c - '0');
    for(unsigned long i=0; i<(aStr.length()-bStr.length()); i++)
        b.insert(b.begin(), 0);

    // 开始计算
    int borrow = 0;
    vector<int> answer(a.size());

    for(int i=a.size()-1; i>=0; i--)
    {
        int tmp = a[i] - borrow - b[i];
        borrow = 0;

        if(tmp >= 0)
            answer[i] = tmp;
        else
        {
            answer[i] = tmp + 10;
            borrow = 1;
        }
    }

    // 去掉前导0
    unsigned long i;
    for(i=0; i<answer.size() && answer[i]==0; i++);

    // a 与 b 完全相等
    if(i == answer.size())
    {
        fout << "0" << endl;
        return 0;
    }

    // 输出结果到文件
    for(; i<answer.size(); i++)
        fout << answer[i];
    fout << endl;

    return 0;
}
